#include "../../inc/skyCanvas.h"
#ifdef _DX90_
namespace Sky
{

    Sky::BoolSky::Canvas::create( i32 w,i32 h,i32 Format_ ,u32 subFormat)
    {
	    _pict = skynew (Pict());
	    xPict* mPict = _pict->getPict();
	    mPict->setUsage(D3DUSAGE_RENDERTARGET);
	    mPict->setType(xPict::Type_Normal);
	    mPict->setWidth(w);
	    mPict->setHeight(h);
	    return (XE_OK == mPict->trySelfCreate());
        
        return vTrue;
    }

    Sky::Void Canvas::Delete()
    {
        _canvas.Detach();
        _pict = vNull;
    }

    Sky::BoolCanvas::attachPict( Pict* pict )
    {
        return _canvas.Attach(_pict->getPict());
    }

    Sky::NType::Pict* Canvas::detachPict()
    {
        _canvas.Detach();
        Pict* p = _pict;
        _pict = vNull;
        return p;
    }

}
#endif
